<?php
/**
 * The main template file.
 *
 * This is the most generic template file in a WordPress theme
 * and one of the two required files for a theme (the other being style.css).
 * It is used to display a page when nothing more specific matches a query.
 * E.g., it puts together the home page when no home.php file exists.
 * Learn more: http://codex.wordpress.org/Template_Hierarchy
 *
 * @package WordPress
 * @subpackage Twenty_Eleven
 */

get_header();
get_template_part( 'slider' );
?>
	<div class="content">
		<div id="homepage" class="clear-fix">
			<div class="hp-col" id="hp-col1">
				<a href="?page_id=114" id="hp-button-1">Click here</a>
				<div id="hp-col-1-wrapper" class="clear-fix">
					<img src="<?php echo get_template_directory_uri(); ?>/src/images/imgTemp-1.png" alt="IFIXIT" />
					<div id="hp-col-1-right">
						<?php
							$my_id = 1;
							$post = get_post($my_id); 
							echo $post->post_content
						?>
					</div>
				</div>
			</div>
			<div class="hp-col" id="hp-col2">
				<div id="hp-col-2-wrapper" class="clear-fix">
					<h3>Services</h3>
					<?php
						$menu = wp_nav_menu( array(
									 'container' =>false,
									 'menu_class' => 'nav',
									 'echo' => false,
									 'before' => '',
									 'after' => '',
									 'link_before' => '',
									 'link_after' => '',
									 'depth' => 0,
									 'items_wrap' => '%3$s',//-- omit <ul></ul>
									 'theme_location' => 'secondary',
									 'walker' => new description_walker())
									 );	
					    $arrMenu = explode('</li>',$menu);
					    for ( $i=0;$i<count($arrMenu);$i++ ){
					    	if ( $i == 0 ){
						    	echo '<div class="col-2-l"><ul>';
					    	}					    	
						    echo '<li>'.$arrMenu[$i].'</li>';
						    if ( $i == 3 ){
						    	echo '</ul></div>';
						    	echo '<div class="col-2-r"><ul>';
						    }
						    if ( $i == count($arrMenu)-1 ){
						    	echo '</ul></div>';
						    }					    	
					    }						    	
					?>								
					<div class="clear"></div>				
				</div>
			</div>
			<div class="hp-col" id="hp-col3">
				<?php 
					 $categoryId = 6;
                     $categories = get_category( $categoryId );                                          	
                ?> 						
				<h3><?php echo $categories->name;?></h3>
				<div id="col-3-l">
					<?php 
						$option = '_category_image' . $categoryId;
						$image = get_option($option);			
					?>
					<img src="<?php echo $image; ?>" alt="" width="87" height="74" />													
				</div>
				<div id="col-3-r">
					<p>
						<?php							
							echo substr($categories->description,0,159);
						?>
					</p> 
					<div class="clear"></div>
					<a href="?cat=6" id="rm-2" class="read-more">Readmore</a>
				</div>
			</div>
		</div>

	</div>
<?php get_footer(); ?>